/************************************************************************/
/* Name : Kiwon Yun
/* Partner's name : Eric Rooney
/* File Name : Deck.h
/* The name of assignment : Iteration 2
/************************************************************************/

#ifndef DECK_H
#define DECK_H

#include "Common.h"
#include <fstream>
#include "Card.h"

using namespace std;

/** This is a class representing a standard, 52 card deck of cards */

class Deck
{
  public:
    /**	 Constructor */
    Deck();  

    /**  Destructor */
    virtual ~Deck();

	/***********************************************************************
	* 1. If a mode is standard mode, the new game create cards in regular.
	*	 After that, randomizes the order of cards in the deck.
	* 2. If a mode is test mode, the new game create cards by using a specific data file.
	*
	* Parameter
	*	a_mode : 'standard mode' or 'test mode'
	*	a_strTestFileName : a test file name for test mode
	*
	* Remark : basic mode is standard mode.
	************************************************************************/
	void InitDeck( E_MODE a_mode = STANDARD_MODE, char* a_strTestFileName = NULL );

	/***********************************************************************
	* Clear cards in the deck, and create cards in regular.
	************************************************************************/
	void CreateStandardDeck();

	/** Randomizes the order of cards in the deck. */
    void shuffleDeck();

    /** Draws a card from the deck, removing the card from the deck. 
     * The return value is the card drawn. Note that the result is undefined 
     * when the deck is empty.*/
    Card* RequestCard();
    
    /** Returns the number of cards remaining in the deck. */
    int getSize() const;
    
    /** Clears out the current deck and reads in a new deck from a file, where 
     * the format is:
     * 
     * $(SUIT)$(VALUE)
     * 
     * Example:
     * 
     * D10
     * C4
     * HA
     * 
     * ...etc. Note that the cards are ordered such that the first card read is
     * at the bottom of the deck and the last is at the top of the deck, and the
     * first to be dealt.*/
    void readDeckFile(string a_strFilename);
    
	/***********************************************************************
	* Release all pointers of cards and clear the vector of cards.
	************************************************************************/
	void RemoveAllCards();
	
	//void PrintCardsInDeck();

  private:
    /* A vector containing the cards in the deck. */
    vector <Card*> m_vecCard; 
};

#endif
